package work;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Money money2 = new PeopleB("李四",789456,15800);
        Money money1 = new PeopleA("张三",123456,10000);
        Scanner scanner = new Scanner(System.in);
        System.out.println("是否插入银行卡?");
        String isFa = scanner.next();
        if (isFa.equals("是")){
            System.out.println("请输入密码:");
            int num = scanner.nextInt();
            if (num == money1.getPassWord()){

                System.out.println("密码正确!登陆成功!");
                System.out.println("**********************欢迎登陆银行系统**********************");
                int is = 1;
                do {
                    System.out.println("*************************************************");
                    System.out.println("请选择你要办理的业务:  1,查询余额  2,取款  3,存款  4,退出");
                    System.out.println("*************************************************");
                    int choose = scanner.nextInt();
                    switch (choose){
                        case 1:
                            money1.se();
                            break;

                        case 2:
                            money1.Qu();
                            break;

                        case 3:
                            money1.cun();
                            break;

                        case 4:
                            System.out.println("退出成功!");
                            is = 0;
                            break;
                    }

                }while (is==1);
            }else if (num == money2.getPassWord()){
                System.out.println("密码正确!登陆成功!");
                System.out.println("**********************欢迎登陆银行系统**********************");
                int is = 1;
                do {
                    System.out.println("*************************************************");
                    System.out.println("请选择你要办理的业务:  1,查询余额  2,取款  3,存款  4,退出");
                    System.out.println("*************************************************");
                    int choose = scanner.nextInt();
                    switch (choose){
                        case 1:
                            money2.se();
                            break;

                        case 2:
                            money2.Qu();
                            break;

                        case 3:
                            money2.cun();
                            break;

                        case 4:
                            System.out.println("退出成功!");
                            is = 0;
                            break;
                    }

                }while (is==1);

            }else {
                System.out.println("密码错误!");
            }
        }else {
            System.out.println("请插入银行卡办理业务!");
        }


    }
}

